<?php
class Alarm {
	protected $_devices = array();
	
	public function addDevice(Alarm_Device_Innterface $_device) {
		$id = spl_object_hash($_device);
		$this->_devices[$id] = $_device;
	}
	
	public function removeDevice(Alarm_Device_Interface $_device) {
		$id = spl_object_hash($_device);
		if(isset($this->_devices[$id])) {
			unset($this->_devices[$id]);
		}
	}
	
	public function notifyDevices(Car_Abstract $_car) {
		foreach($this->_devices as $device) {
			$device->alarmStarted($_car);
		}
	}	
}